<?php
/**
 * Created by PhpStorm.
 * User: 驭风者
 * Date: 2019/11/11
 * Time: 9:13
 */
$l_name = $_POST['l_name'];
$l_pwd = $_POST['l_pwd'];
$dbh = new PDO('mysql:host=localhost;dbname=test', "root", "root");
$l_name = $dbh ->quote( $l_name );
$l_pwd  = $dbh ->quote( $l_pwd );

$sql = "select * from  Login where l_name = $l_name and l_pwd = $l_pwd";

$res = $dbh ->query( $sql );

if( $res ){
    $arr['code'] = 0;
    $arr['msg'] = "OK" ;
    $arr['data'] = "";
}else{
    $arr['code'] = 1;
    $arr['msg'] = "NO!!!数据错误!!!!!" ;
    $arr['data'] = "";
}
echo json_encode( $arr );

?>
















